package com.stt.design.command.impl;

import com.stt.base.model.Device;
import com.stt.design.command.DeviceCommand;
import lombok.RequiredArgsConstructor;

/**
 * 设备参数调节命令
 * 封装设备参数调节操作
 */
@RequiredArgsConstructor
public class DeviceParameterCommand implements DeviceCommand {
    private final Device device;
    private final Integer targetParameter;
    private final Integer previousParameter;
    
    @Override
    public void execute() {
        device.setParameter(targetParameter);
    }
    
    @Override
    public void undo() {
        device.setParameter(previousParameter);
    }
    
    @Override
    public String getDescription() {
        return String.format("%s 设备参数设置为 %d", 
            device.getName(), 
            targetParameter
        );
    }
} 